package cn.qingyun.gis.modules.init.system.constant.enums;

import io.swagger.models.auth.In;

/**
 * 角色权限码
 * */
public enum RoleCodeEnum {
    ONE(1,"省权限"),
    TWO(2,"市权限"),
    THREE(3,"区权限"),
    FOUR(4,"网格权限"),
    FIVE(5,"渠道权限"),
    SIX(6,"自有人员权限"),
    SEVEN(7,"直销人员权限");

    /**
     * 角色编号
     */
    private Integer code;

    /**
     * 角色值
     */
    private String value;

    RoleCodeEnum(Integer code, String value) {
        this.code = code;
        this.value = value;
    }

    public final Integer getCode() {
        return code;
    }

    public final String getValue() {
        return value;
    }
    public static String getValueByCode(Integer code){
        for (RoleCodeEnum permission : RoleCodeEnum.values()) {
            if (permission.getCode().equals(code)) {
                return permission.getValue();
            }
        }
        throw new IllegalArgumentException("未找到该角色类型，code值："+code);
    }
}
